﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using SourFruit.menu;

namespace SourFruit.player
{
    public enum InputActions { up, down, left, right, jump, confirm, escape }

    public abstract class Input
    {
        protected Boolean menuOpen = true, changingKeys = false;
        public Object UP, DOWN, LEFT, RIGHT, JUMP, CONFIRM, BACK;
        protected InputActions KeyToBeChanged;

        public Input()
        {
        }

        public Input(Object up, Object down, Object left, Object right, Object jump, Object confirm, Object back)
        {
            this.UP = up; this.DOWN = down; this.LEFT = left; this.RIGHT = right; this.JUMP = jump; this.CONFIRM = confirm;
            this.BACK = back;
        }
            

        /// <summary>
        /// Listens to input and updates the player accordingly.
        /// </summary>
        public abstract void Update(MenuWindow mainMenu, Physics player, GameTime gametime, Boolean gameEnded);

        public abstract InputActions?[] Update(GameTime gametime, Boolean gameEnded);

        public void bindToKey(InputActions input)
        {
            KeyToBeChanged = input;
            changingKeys = true;
        }
    }
}
